/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nominalitzacions.ui;

import java.io.FileNotFoundException;
import java.io.IOException;
import nominalitzacions.domain.PasswordDomainController;

/**
 *
 * @author Administrador
 */
public class LoginAdminViewController {

    private LoginAdminView LAV;
    private PasswordDomainController PDC;
    
    private PrincipalViewController PVC;
    private String what = null;

    public LoginAdminViewController() throws IOException{
        LAV = new LoginAdminView(this);
        PDC = new PasswordDomainController();
    }
    
    public LoginAdminViewController(PrincipalViewController PVC) throws IOException{
        this.PVC = PVC;
        LAV = new LoginAdminView(this);
        PDC = new PasswordDomainController();
    }

    public void setVisible(){
        LAV.setVisible(true);
    }
    
    public void setVisible(String what){
        this.what = what;
        LAV.setVisible(true);
    }
    
    public void goToView(){
        LAV.setVisible(false);
        PVC.on();
        PVC.goToView(what);
    }

    public void setInvisible(){
        LAV.setVisible(false);
    }

    public boolean verificationPass(String act) throws FileNotFoundException{
        return act.equals(PDC.getPass());
    }

    public void accept(){
        
    }

    public void cancel(){
        LAV.setVisible(false);
        PVC.on();
    }
}
